package com.bmw.blog.service;

import java.util.List;

import com.bmw.blog.mapper.bmwMedia.BmwMediaMapper;
import com.bmw.blog.model.BmwMedia;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;


/**
 * Service类
 * 
 * @author Jinmy
 * @date 2019-01-10 08:16:33
 */
@Service
public class BmwMediaService {

    @Autowired
    private BmwMediaMapper bmwMediaMapper;




    /**
     * 新增实体类到数据库
     * 
     */
    @Transactional
    public int add(BmwMedia record) {
        return bmwMediaMapper.add(record);
    }

    /**
     * 根据主键删除该记录
     * 
     */
    @Transactional
    public int delete(Integer id) {
        return bmwMediaMapper.delete(id);
    }

    /**
     * 根据主键修改该记录
     * 
     */
    @Transactional
    public int update(BmwMedia record) {
        return bmwMediaMapper.update(record);
    }

    /**
     * 根据主键查询该记录
     * 
     */
    public BmwMedia findById(Integer id) {
        return bmwMediaMapper.findById(id);
    }

    /**
     * 根据查询条件进行模糊查询
     * 
     */
    public List<BmwMedia> findLike(BmwMedia condition) {
        return bmwMediaMapper.findLike(condition);
    }

    /**
     * 根据查询条件进行匹配查询
     * 
     */
    public List<BmwMedia> findList(BmwMedia condition) {
        return bmwMediaMapper.findList(condition);
    }
}